﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            var user = new User() {Name="Tom",Age=68};

            var runner = new FilterRunner.Runner<User>(user, p =>
            {

                Console.WriteLine("Hello " +p.Name);

                return new FilterRunner.RunnerMessage() {IsSuccess=true,Message=" ok "};

            });

            //add filter
            runner.Filters.Add(new CheckUserRunnerFilter<User>());


            //run 
           var result= runner.Run();

            Console.WriteLine("-----------"+result.Message+"---------------");
            Console.ReadKey();

        }

    }



    internal class User
    {
        public string Name { get; set; }

        public short Age { get; set; }

    }
}
